home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Atari Compendium
/
The Atari Compendium (Toad Computers) (1994).iso
/
files
/
umich
/
network
/
mail
/
pathalia.zoo
/
src
/
parse.c
< prev
next >
Wrap
C/C++ Source or Header
|
1991-01-12
|
28KB
|
1,052 lines
#ifndef lint
char yysccsid[] = "@(#)yaccpar 1.4 (Berkeley) 02/25/90";
#endif
#line 2 "parse.y"
/* pathalias -- by steve bellovin, as told to peter honeyman */
#ifndef lint
static char *sccsid = "@(#)parse.y 9.10 88/09/07";
#endif /* lint */
#include "def.h"
/* scanner states (yylex, parse) */
#define OTHER 0
#define COSTING 1
#define NEWLINE 2
#define FILENAME 3
/* exports */
long Tcount;
extern void yyerror();
/* imports */
extern node *addnode(), *addprivate();
extern void fixprivate(), alias(), deadlink(), deletelink();
extern link *addlink();
extern int strcmp();
extern char *strsave();
extern int optind;
extern char *Cfile, *Netchars, **Argv;
extern int Lineno, Argc;
/* privates */
STATIC void fixnet(), adjust();
STATIC int yylex(), yywrap(), getword();
static int Scanstate = NEWLINE; /* scanner (yylex) state */
int Donelast = 0; /* we're all out of files to parse */
/* flags for ys_flags */
#define TERMINAL 1
#line 39 "parse.y"
typedef union {
node *y_node;
Cost y_cost;
char y_net;
char *y_name;
struct {
node *ys_node;
Cost ys_cost;
short ys_flag;
char ys_net;
char ys_dir;
} y_s;
} YYSTYPE;
#line 55 "y_tab.c"
#define SITE 257
#define HOST 258
#define STRING 259
#define COST 260
#define NET 261
#define EOL 262
#define PRIVATE 263
#define DEAD 264
#define DELETE 265
#define FILETOK 266
#define ADJUST 267
#define YYERRCODE 256
short yylhs[] = { -1,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 3, 3, 3, 8, 8, 8, 8, 8, 8,
1, 1, 1, 2, 2, 4, 4, 4, 6, 6,
6, 9, 9, 7, 7, 7, 15, 15, 5, 5,
5, 16, 12, 12, 12, 11, 11, 10, 17, 20,
20, 20, 21, 21, 22, 23, 18, 19, 24, 24,
24, 25, 13, 26, 27, 13, 14, 14, 14, 14,
14, 14, 14,
};
short yylen[] = { 2,
0, 2, 3, 3, 3, 3, 3, 3, 3, 3,
2, 3, 4, 2, 1, 1, 1, 1, 1, 1,
1, 2, 2, 1, 3, 3, 3, 2, 5, 6,
6, 1, 2, 1, 3, 2, 4, 3, 1, 3,
2, 4, 1, 3, 2, 1, 3, 1, 4, 1,
3, 2, 1, 3, 0, 0, 6, 4, 1, 3,
2, 2, 0, 0, 0, 5, 1, 2, 3, 3,
3, 3, 3,
};
short yydefred[] = { 0,
0, 0, 11, 15, 2, 0, 0, 0, 0, 0,
32, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 55, 0, 3, 0, 4, 0,
5, 24, 0, 0, 0, 0, 0, 0, 0, 6,
7, 8, 9, 10, 39, 38, 0, 0, 0, 43,
0, 0, 0, 0, 50, 0, 48, 0, 0, 59,
0, 27, 22, 0, 26, 64, 12, 23, 0, 34,
0, 0, 37, 0, 0, 42, 0, 0, 49, 56,
62, 0, 58, 13, 25, 0, 0, 0, 0, 40,
47, 44, 54, 51, 0, 60, 67, 0, 0, 0,
0, 35, 0, 29, 57, 0, 0, 0, 0, 0,
0, 0, 30, 31, 69, 0, 0, 72, 73, 66,
};
short yydgoto[] = { 2,
36, 37, 12, 13, 47, 14, 71, 15, 16, 49,
50, 51, 67, 100, 17, 18, 19, 20, 21, 54,
55, 56, 95, 59, 60, 86, 112,
};
short yysindex[] = { -234,
-237, -55, 0, 0, 0, -96, -93, -78, -74, -72,
0, -41, -36, -204, -44, -109, -202, -178, -177, -176,
-175, -104, -168, -167, 0, -166, 0, -14, 0, -165,
0, 0, -51, -164, -163, 59, -161, -5, -154, 0,
0, 0, 0, 0, 0, 0, -21, 0, -153, 0,
-20, 0, -150, -18, 0, -142, 0, 59, -16, 0,
59, 0, 0, 57, 0, 0, 0, 0, -154, 0,
-15, -137, 0, -166, -168, 0, -166, -167, 0, 0,
0, -166, 0, 0, 0, -35, -13, -135, -38, 0,
0, 0, 0, 0, -2, 0, 0, -35, -35, 14,
59, 0, 59, 0, 0, 28, 26, -35, -35, -35,
-35, 83, 0, 0, 0, 28, 28, 0, 0, 0,
};
short yyrindex[] = { 1,
0, 0, 0, 0, 0, -42, -24, -22, -19, -17,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, -33, 0, -32,
0, 0, 0, 0, -103, -31, -40, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, -37, 0, 0,
0, -29, 0, 0, 0, 0, 0, -12, 0, 0,
-31, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, -11, 0, 0, -10, 0, 0, -9, 0, 0,
0, -4, 0, 0, 0, 0, 0, 3, -136, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 84,
-136, 0, -136, 0, 0, 31, 0, 0, 0, 0,
0, 0, 0, 0, 0, 36, 37, 0, 0, 0,
};
short yygindex[] = { 0,
99, 96, 0, 0, 0, 0, 61, 0, 0, 24,
56, 0, -6, -45, 0, 0, 0, 0, 0, 0,
54, 0, 0, 0, 51, 0, 0,
};
#define YYTABLESIZE 268
short yytable[] = { 21,
1, 66, 28, 21, 99, 11, 46, 30, 34, 98,
14, 28, 63, 39, 53, 34, 35, 16, 16, 33,
46, 1, 72, 75, 3, 78, 22, 82, 88, 23,
88, 63, 41, 45, 52, 17, 17, 18, 18, 61,
19, 19, 20, 20, 24, 34, 36, 53, 25, 58,
26, 81, 106, 107, 84, 110, 108, 31, 109, 40,
111, 1, 116, 117, 118, 119, 115, 110, 108, 110,
109, 68, 111, 68, 111, 68, 70, 71, 70, 71,
70, 71, 104, 41, 42, 43, 44, 46, 48, 52,
57, 62, 64, 65, 113, 53, 114, 91, 66, 68,
93, 53, 70, 73, 76, 58, 79, 74, 83, 89,
77, 101, 63, 41, 45, 52, 80, 69, 85, 90,
61, 102, 105, 120, 65, 63, 61, 36, 63, 87,
92, 94, 96, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 38, 45, 0, 0, 0, 0, 33, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 4, 0, 0, 32, 5, 6, 7, 8,
9, 10, 32, 0, 16, 0, 33, 0, 16, 0,
27, 21, 103, 48, 97, 29, 0, 0, 14, 28,
63, 48, 17, 0, 18, 0, 17, 19, 18, 20,
0, 19, 32, 20, 0, 0, 33, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
0, 0, 1, 1, 1, 1, 1, 1,
};
short yycheck[] = { 40,
0, 40, 44, 44, 40, 61, 44, 44, 60, 45,
44, 44, 44, 123, 44, 60, 61, 60, 61, 123,
125, 256, 44, 44, 262, 44, 123, 44, 44, 123,
44, 44, 44, 44, 44, 60, 61, 60, 61, 44,
60, 61, 60, 61, 123, 60, 44, 24, 123, 26,
123, 58, 98, 99, 61, 42, 43, 262, 45, 262,
47, 61, 108, 109, 110, 111, 41, 42, 43, 42,
45, 41, 47, 43, 47, 45, 41, 41, 43, 43,
45, 45, 89, 262, 262, 262, 262, 125, 257, 257,
257, 257, 257, 257, 101, 125, 103, 74, 40, 261,
77, 78, 257, 125, 125, 82, 125, 261, 125, 125,
261, 125, 125, 125, 125, 125, 259, 123, 62, 257,
125, 257, 125, 41, 41, 262, 28, 125, 33, 69,
75, 78, 82, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, 261, 257, -1, -1, -1, -1, 261, -1, -1,
-